package com.sdonkey.score.exception;

/**
 * Created by zc on 2017/01/03 0003.
 */
public class CustomerException extends Exception {
    public static final CustomerException SUCCESS = new CustomerException("1000", "成功");
    public static final CustomerException SERVER_ERROR = new CustomerException("1001", "服务器异常");
    public static final CustomerException PERMISSION_DENIED = new CustomerException("1002", "您的权限不足");
    public static final CustomerException CONNECTION_NETERROR = new CustomerException("1003", "网络连接异常");
    public static final CustomerException CONNECTION_TIMEOUT = new CustomerException("1004", "连接超时");
    public static final CustomerException BUSINESS_ERROR = new CustomerException("1005", "业务异常");
    public static final CustomerException SELFDEFINED_ERROR = new CustomerException("1006", "其他自定义异常");

    private String code;
    private String message;

    public CustomerException() {
    }

    public CustomerException(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public CustomerException(CodeMessage cm) {
        this.code = cm.getCode();
        this.message = cm.getMessage();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
